package corbeille;

import ihm.Accueil;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.Color;
import javax.swing.SwingConstants;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.JTextPane;
import javax.swing.JInternalFrame;
import javax.swing.JTabbedPane;
import javax.swing.JProgressBar;
import javax.swing.border.LineBorder;
import javax.swing.JSeparator;

public class Patient_Ajouter extends JFrame implements ActionListener
{

	private JPanel contentPane;
	private JLabel lblAjouterUnPatient;
	private JButton btnQuitter;
	private JButton btnRetour;
	private JButton btnValider;
	private JLabel lblNom;
	private JLabel lblPrnom;
	private JLabel lblDateDeNaissance;
	private JLabel lblRue;
	private JLabel lblVille;
	private JLabel lblCodePostal;
	private JTextField textField_1;
	private JTextField textField_2;
	private JTextField textField_3;
	private JTextField textField_4;
	private JTextField textField_5;
	private JTextField textField;
	private JSeparator separator;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args)
	{
		EventQueue.invokeLater(new Runnable()
		{
			public void run()
			{
				try
				{
					Patient_Ajouter frame = new Patient_Ajouter();
					frame.setVisible(true);
				} catch (Exception e)
				{
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Patient_Ajouter()
	{
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 840, 580);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		lblAjouterUnPatient = new JLabel("Ajouter un patient");
		lblAjouterUnPatient.setBounds(5, 5, 812, 50);
		lblAjouterUnPatient.setHorizontalAlignment(SwingConstants.CENTER);
		lblAjouterUnPatient.setForeground(new Color(0, 0, 102));
		lblAjouterUnPatient.setFont(new Font("Comic Sans MS", Font.PLAIN, 35));
		contentPane.add(lblAjouterUnPatient);
		
		btnQuitter = new JButton("Quitter");
		btnQuitter.addActionListener(this);
		btnQuitter.setBounds(713, 495, 97, 25);
		contentPane.add(btnQuitter);
		
		btnRetour = new JButton("Retour");
		btnRetour.addActionListener(this);
		btnRetour.setBounds(495, 495, 97, 25);
		contentPane.add(btnRetour);
		
		btnValider = new JButton("Valider");
		btnValider.setBounds(604, 495, 97, 25);
		contentPane.add(btnValider);
		
		lblNom = new JLabel("NOM :");
		lblNom.setHorizontalAlignment(SwingConstants.RIGHT);
		lblNom.setBounds(257, 160, 97, 16);
		contentPane.add(lblNom);
		lblNom.setFont(new Font("Tahoma", Font.PLAIN, 14));
		
		lblPrnom = new JLabel("Pr\u00E9nom :");
		lblPrnom.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblPrnom.setHorizontalAlignment(SwingConstants.RIGHT);
		lblPrnom.setBounds(231, 188, 123, 16);
		contentPane.add(lblPrnom);
		
		lblDateDeNaissance = new JLabel("Date de naissance :");
		lblDateDeNaissance.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblDateDeNaissance.setHorizontalAlignment(SwingConstants.RIGHT);
		lblDateDeNaissance.setBounds(156, 217, 198, 16);
		contentPane.add(lblDateDeNaissance);
		
		lblRue = new JLabel("Rue :");
		lblRue.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblRue.setHorizontalAlignment(SwingConstants.RIGHT);
		lblRue.setBounds(298, 246, 56, 16);
		contentPane.add(lblRue);
		
		lblVille = new JLabel("Ville :");
		lblVille.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblVille.setHorizontalAlignment(SwingConstants.RIGHT);
		lblVille.setBounds(298, 275, 56, 16);
		contentPane.add(lblVille);
		
		lblCodePostal = new JLabel("Code Postal :");
		lblCodePostal.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblCodePostal.setHorizontalAlignment(SwingConstants.RIGHT);
		lblCodePostal.setBounds(244, 304, 110, 16);
		contentPane.add(lblCodePostal);
		
		textField_1 = new JTextField();
		textField_1.setColumns(10);
		textField_1.setBounds(366, 298, 191, 22);
		contentPane.add(textField_1);
		
		textField_2 = new JTextField();
		textField_2.setColumns(10);
		textField_2.setBounds(366, 269, 191, 22);
		contentPane.add(textField_2);
		
		textField_3 = new JTextField();
		textField_3.setColumns(10);
		textField_3.setBounds(366, 240, 191, 22);
		contentPane.add(textField_3);
		
		textField_4 = new JTextField();
		textField_4.setColumns(10);
		textField_4.setBounds(366, 211, 191, 22);
		contentPane.add(textField_4);
		
		textField_5 = new JTextField();
		textField_5.setColumns(10);
		textField_5.setBounds(366, 182, 191, 22);
		contentPane.add(textField_5);
		
		textField = new JTextField();
		textField.setColumns(10);
		textField.setBounds(366, 154, 191, 22);
		contentPane.add(textField);
		
		separator = new JSeparator();
		separator.setBounds(231, 84, 372, 16);
		contentPane.add(separator);
	}

	public void actionPerformed(ActionEvent evt) {
		if (evt.getSource()==btnQuitter)
		{
			System.exit(0); 
		}
		else
		{
			if (evt.getSource()==btnRetour)
			{
				this.dispose();
				Accueil ac = new Accueil(); 
				
			}
		}
	}
}
